<extend name="./base"/>
<block name="title"><?php echo $_SESSION['username'] ?></block>
<block name="body">
    <form method="post">
        课程名称：
        <input type="text" name="courseitemname" placeholder="课程标识"><br/>
        最大人数：
        <input type="text" name="maxpeople" placeholder="最大人数"><br/>
        开始时间：
        <input type="date" name="startime" placeholder="开始时间"><br/>
        结束时间：
        <input type="date" name="endtime" placeholder="结束时间"><br/>
        时间：<a class="addTimeitem">添加时间段</a>
        <dl class="time_outbox">
            <include file="./Application/Common/View/timeitem.html" />
        </dl>
        <?php
            if($_SESSION['type'] != 1){
                echo '选择老师，登机构写好再来完善';
            }
        ?>
        <button type="submit" class="btn btn-default">添加</button>
    </form>
</block>
<block name="myjs">
    <load href='__PUBLIC__/datepicker/bootstrap-datetimepicker.min.css'/>
    <load href='__PUBLIC__/datepicker/bootstrap-datetimepicker.js'/>
    <script type="text/html" id="timeitem_html">
        <include file="./Application/Common/View/timeitem.html" />
    </script>
    <script>
        $(function () {
            $('.addTimeitem').click(function () {
                $('.time_outbox').append($('#timeitem_html').html());
            })
            $(document).on('click','.delTimeitem',function(){
                $(this).parent().remove();
            })
        })
    </script>
</block>
